package chpt05;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class FlyShowTest {
	public static void flyShow(Flyable[] flys){
	    for (Flyable e : flys) {
	        e.flyShow();
	    }
	}
	
	public static void main(String[] args) {
		Flyable bird = new Bird();
		bird.flyShow();
		Flyable plane = new Plane();
		Flyable[] flyingObjects = new Flyable[2];
		flyingObjects[0] = bird;
		flyingObjects[1] = plane;
		FlyShowTest.flyShow(flyingObjects);
		// instanceofTest();
	}
	
	public static void instanceofTest() {
		Plane p = new Plane();
		List<String> strList = new ArrayList<String>();
		boolean x = p instanceof Flyable;  // true
		x = p instanceof Comparable;       // false
		x = strList instanceof List;       // true
		x = strList instanceof Collection; // true
		System.out.println(x);
		
	}
	
}
